package com.jzo2o.customer.controller.inner;


import com.jzo2o.api.customer.dto.response.AddressBookResDTO;
import com.jzo2o.common.utils.BeanUtils;
import com.jzo2o.customer.service.IAddressBookService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("inner/addressBook")
@Api(tags = "内部接口 - 普通用户相关接口")
public class InnerAddressBookController {
    @Resource
    private IAddressBookService addressBookService;

    @GetMapping("/getAddressBookInfo/{id}")
    @ApiOperation("远程调用地址薄接口")
    public AddressBookResDTO getAddressBookInfo(@PathVariable("id") @ApiParam(name = "id", value = "地址薄id")
                                                Long id) {
        return BeanUtils.copyBean(addressBookService.getById(id), AddressBookResDTO.class);
    }
}
